package tests;

import Model.Task;
import junit.framework.TestCase;
import org.junit.Test;

/**
 * TODO description of class
 *
 * @author psyomn
 */
public class TaskTest extends TestCase {

    @Test
    public void testRemoveName() throws Exception {
        Task task = new Task("test", new java.sql.Date(0), null);
        task.removeName("test");
        assertEquals(task.getName(), "");
    }

    @Test
    public void testSetDone() throws Exception {
        Task task = new Task("test", new java.sql.Date(0), null);
        task.setDone(true);
        assertTrue(task.getDone());
    }

    @Test
    public void testSetName() throws Exception {
        Task task = new Task("test", new java.sql.Date(0), null);
        task.setName("setname");
        assertEquals(task.getName(), "setname");
    }

    @Test
    public void testGetName() throws Exception {
        Task task = new Task("test", new java.sql.Date(0), null);
        assertEquals(task.getName(), "test");
    }

    @Test
    public void testGetDueDate() throws Exception {
        Task task = new Task("test", new java.sql.Date(0), null);
        assertEquals(task.getDueDate(), new java.sql.Date(0));
    }

    @Test
    public void testGetDueDateString() throws Exception {
        Task task = new Task("test", new java.sql.Date(0), null);
        assertEquals(task.getDueDate().toString(),task.getDateString());
    }

    @Test
    public void testGetDone() throws Exception {
        Task task = new Task("test", new java.sql.Date(0), null);
        assertFalse(task.getDone());
    }

    @Test
    public void testGetType() throws Exception {
        Task task = new Task("test", new java.sql.Date(0), null);
        assertEquals(task.getType(), null);
    }
}
